
public class BotConfig {
	private String urlBase = "";//"http://vls2.icm.edu.pl/cgi-bin/";
	
	private String searchPage = "";
	private String searchFields = "";
	private String searchJoinType = "";//AdvBooleanJoiner=AND
	private String searchFromYear = "";//fromyear=1998
	private String searchToYear = "";//toyear=1999&
	private String searchConstQuery = "";
		
	private String outPutFolder = "";
	
	private Boolean extLoging = new Boolean(false);
	
	public void MakeDefaults(boolean local){
		if(local){
			urlBase = "file:/F:/java/workspace/IcmBot/Examples/";
			searchPage = "search2.htm";
		}
		else {
			urlBase = "http://vls2.icm.edu.pl/cgi-bin/";	
			searchPage = "search.pl";
			
			searchFields = "expert system";
			searchJoinType = "AND";
			searchFromYear = "1998";
			searchToYear = "1999";
			searchConstQuery = "SearchTemplate=search_form.advanced&fields=Any&search_field2=&fields2=Any&Database=elsevier_1990&Database=springer_1990&Category=all_categories&ArticleType=All+Types...&Language=&drpast=none&daterange=yearrange&GetSearchResults=Submit+Query";
		}		
		extLoging = new Boolean(true);
		outPutFolder = "C:\\Articles";
	}
	
	public String ConstructSearchURI(){
		String retStr = urlBase + searchPage;
		String mark = "?";
		
		if(searchFields != ""){
			retStr += mark + "search_field=" + searchFields.replace(' ', '+');
			mark = "&";
		}
		if(searchJoinType != ""){
			retStr += mark + "AdvBooleanJoiner=" + searchJoinType;
			mark = "&";
		}
		if(searchFromYear != ""){
			retStr += mark + "fromyear=" + searchFromYear;
			mark = "&";
		}
		if(searchToYear != ""){
			retStr += mark + "toyear=" + searchToYear;
			mark = "&";
		}
		if(searchConstQuery != ""){
			retStr += mark + searchConstQuery;
			mark = "&";
		}
		return retStr;
	}

	public String getUrlBase() {
		return urlBase;
	}

	public void setUrlBase(String urlBase) {
		this.urlBase = urlBase;
	}

	public String getSearchPage() {
		return searchPage;
	}

	public void setSearchPage(String searchPage) {
		this.searchPage = searchPage;
	}

	public String getSearchFields() {
		return searchFields;
	}

	public void setSearchFields(String searchFields) {
		this.searchFields = searchFields;
	}

	public String getSearchJoinType() {
		return searchJoinType;
	}

	public void setSearchJoinType(String searchJoinType) {
		this.searchJoinType = searchJoinType;
	}

	public String getSearchFromYear() {
		return searchFromYear;
	}

	public void setSearchFromYear(String searchFromYear) {
		this.searchFromYear = searchFromYear;
	}

	public String getSearchToYear() {
		return searchToYear;
	}

	public void setSearchToYear(String searchToYear) {
		this.searchToYear = searchToYear;
	}

	public String getSearchConstQuery() {
		return searchConstQuery;
	}

	public void setSearchConstQuery(String searchConstQuery) {
		this.searchConstQuery = searchConstQuery;
	}

	public String getOutPutFolder() {
		return outPutFolder;
	}

	public void setOutPutFolder(String outPutFolder) {
		this.outPutFolder = outPutFolder;
	}

	public Boolean getExtLoging() {
		return extLoging;
	}

	public void setExtLoging(Boolean extLoging) {
		this.extLoging = extLoging;
	}
}
